package com.lxlg.lxlg_order.client;

import com.lxlg.core.utils.Result;
import com.lxlg.lxlg_order.client.param.PayRechargeOrderForm;
import com.lxlg.lxlg_order.client.param.Score2MoneyForm;
import com.lxlg.lxlg_order.client.param.UserRechargeForm;
import com.lxlg.lxlg_order.client.result.RechargeOrderInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;

/**
 * name是项目名，contextId是client的名字
 */
@FeignClient(contextId = "VipRechargeClient",name="orderservice")
@RequestMapping("/orderservice/infra/recharge-vip")
public interface VipRechargeClient {
    //生成充值订单
    @PostMapping("newRechargeOrder")
    public Result<RechargeOrderInfo> newRechargeOrder(@Valid @RequestBody UserRechargeForm userRechargeForm );

    /**
     * 支付充值订单返回支付信息
     * @param payRechargeOrderForm
     * @return
     */
    @PostMapping("payRechargeOrder")
    public void payRechargeOrder(@Valid @RequestBody PayRechargeOrderForm payRechargeOrderForm) ;

    //提现
    @PostMapping("getRealMoney")
    public Result<String> getRealMoney(@Valid @RequestBody Score2MoneyForm score2MoneyForm) ;

}
